/**************************************************************
 * fetchlyric_winampcn.h - 
 * Copyright (c) 2009  Qin Xiaoxue  <crs.chin@gmail.com>
 *
 * This file is  free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
**************************************************************/


#ifndef __FETCHLYRIC_WINAMPCN_H
#define __FETCHLYRIC_WINAMPCN_H

#include "fetchlyric.h"

/*
 * http://www.winampcn.com/lyrictransfer/get.aspx?song=<SONG>&artist=<ARTIST>&lsong=<SONGNAME>&Datetime=20060601
 * variable in the url is supposed to be gb2312 encoded, returned data is also gb2312 encoded.
 * http://www.winampcn.com/lrceng/get.aspx?song=<SONG>&artist=<ARTIST>&lsong=<SONGNAME>&prec=1&Datetime=20060601
 * everything about this url is utf-8 encoded
 *
 *FIXME: @song seem irrelevent.
 */

#define WINAMPCN_URL_UTF8

#ifdef WINAMPCN_URL_UTF8
#define WINAMPCN_URL "http://www.winampcn.com/lrceng/get.aspx?"
#else
#define WINAMPCN_URL_GB2312
#define WINAMPCN_URL "http://www.winampcn.com/lyrictransfer/get.aspx?"
#endif

#define LYRIC_DIR ".lyrics"

struct lyric_url_winampcn {
  char *artist;
  char *songname;
  char *album;

  char *url;
  struct lyric_url_winampcn *next;
};



FILE *url_open(char *url);

struct lyric_url_winampcn *parsexml(FILE *fp, const char *encoding);



#endif /* __FETCHLYRIC_WINAMPCN_H */

